﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.HtmlControls;

namespace Dala.Helpers
{
    public class MessageDisplayHelper
    {
        public static void DisplayMessage(String message, HtmlGenericControl divMessage,HtmlGenericControl ulMessage,bool isError=default(bool),bool isInfo=default(bool))
        {
            String formatMessage = "<li>" + message + "</li>";

            if (isInfo == default(bool))
            {
                if (isError)
                    ulMessage.Attributes.Add("class","error");
                else
                    ulMessage.Attributes.Add("class","success");
            }
            else
                ulMessage.Attributes.Add("class", "notice");

            ulMessage.InnerHtml = formatMessage;
            divMessage.Style.Value = "display:block;";

        }

        public static void ClearMessage(HtmlGenericControl divMessage, HtmlGenericControl ulMessage)
        {
            ulMessage.InnerHtml = String.Empty;
            divMessage.Style.Value = "display:none;";
        }
    
    }//end class
}